package LadderRace;

import java.util.*;

/**
 * Enjoy programming!!!
 * Time: 2021/11/2 -  19:40
 */
public class Hourglass01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();//a是共有的符号数
        int i = 1;//i是计数的，单边层数(除1外）
        int h = 0;//h是总共所需符号数
        int h1 = 0;//h的上一次
        int i1;//i1是变化的层数
//        int a1;//a减去用掉的h后
        String s = in.next();

        while (true) {
            i++;
            h = 1 + 2 * (i + 2) * i;
//            System.out.println(h);
//            System.out.println(i);
//            h1 += h;
            if (a < h) {
                a = a - h1;
                break;
            }
            h1 = h;

        }
        i--;
        i1 = i;
        int i2 = 1;
//        System.out.println(h1);
//        System.out.println(i - 1);
//        System.out.println(i);
        for (int k = 0; k < i; k++) {
            for (int b = 0; b < i - i1; b++)
                System.out.print(" ");
            for (int j = 0; j < 2 * i1 + 1; j++) //打印一行
                System.out.print(s);
            i1--;
            System.out.println();
        }
        for (int b = 0; b < i - i1; b++)
            System.out.print(" ");
        System.out.println(s);
        for (int k = 0; k < i; k++) {
            for (int b = 0; b < i - i2; b++)
                System.out.print(" ");
            for (int j = 0; j < 2 * i2 + 1; j++) //打印一行
                System.out.print(s);
            i2++;
            System.out.println();
            if (i2 == i + 1)
                break;
        }
        System.out.println(a);
    }
}
